﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

#include "GnufExtension.h"
#include <QDialog>

namespace gnuf
{
    class ScaleFactor;
    class GNUF_EXTENSION_EXPORT QtDialog : public QDialog
    {
        Q_OBJECT
    public:
        typedef struct { int left, top, right, bottom; } ButtonMargin;
        explicit QtDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
        virtual ~QtDialog() {}

        void setButtonSize(QPushButton* pushButton);

    protected:
        // Inherits QDialog...
        virtual void paintEvent(QPaintEvent *) override;
        virtual bool nativeEvent(const QByteArray &, void *, long *) override;

        virtual void onScaleFactorChanged(const ScaleFactor &) {}
    };
}

